/*
练习4.1 根据后序和中序遍历输出先序遍历 (25分)
time:20201217 10:09 AM
key:1.每一次递归分成三步 赋值 分别为左右子树在原数组上切片出合适的数组 如果数组不空 则递归本流程
user：ldc
*/

#include <iostream>
using namespace std;
#include<stack>
#include<algorithm>
#include<queue>
#include<math.h>
#include<string>
class Tree
{
public:
	int data;
	Tree* lchild;
	Tree* rchild;

	Tree()
	{
		data = -1;
		lchild = NULL;
		rchild = NULL;
	}
};
void read(Tree* node)
{
	if (node != NULL)
	{
		cout <<" "<<node->data;
		read(node->lchild);
		read(node->rchild);
	}
}
void creat(vector<int> array,int j)
{
	vector<int> array1 = array;
	array1.erase(find(begin(array1), end(array1), j));
	sort(array1.begin(), array1.end());
	cout << array1[array1.size()-1] << endl;
}
int main()
{
	long long n;
	long long a;
	long long b;
	cin >> n >> a >> b;
	if (a != 0)
	{
		long long sum = 0;
		long long y = floor(n / (a+b));
		long long x = n % (a+b);
		sum = y * a;
		if (x > a)
		{
			sum += a;
		}
		else
		{
			sum += x;
		}
		cout << sum;
	}
	else
	{
		cout << 0;
	}
}




